import React from 'react';
import { connect } from './react-redux';

@connect(({ reducer1 }) => ({ reducer1 }))
export default class extends React.Component {
  componentDidMount = () => {
    setTimeout(() => {
      this.props.dispatch({
        type: 'reducer1/setState',
        payload: {
          name: '修改后的name',
        },
      });
    }, 2000);
  };
  render() {
    console.log(this.props);
    return <div>{this.props.reducer1.name}</div>;
  }
}
